import request from '@/utils/request'

// 查询公交线路列表
export function listLine(query) {
    return request({
        url: '/bus/line/list',
        method: 'get',
        params: query
    })
}

// 查询公交线路详细
export function getLine(id) {
    return request({
        url: '/bus/line/' + id,
        method: 'get'
    })
}

// 新增公交线路
export function addLine(data) {
    return request({
        url: '/bus/line',
        method: 'post',
        data: data
    })
}

// 修改公交线路
export function updateLine(data) {
    return request({
        url: '/bus/line',
        method: 'put',
        data: data
    })
}

// 删除公交线路
export function delLine(id) {
    return request({
        url: '/bus/line/' + id,
        method: 'delete'
    })
}

// 获取弹窗select数据
export function getSelectData() {
    return request({
        url: '/bus/line/selectData',
        method: 'post',
    })
}

// 获取站点列表
export function getLineStationList(params) {
  return request({
    url: '/bus/lineStation/list',
    method: 'get',
    params: params
  })
}

// 删除站点
export function delLineStation(id) {
  return request({
    url: '/bus/lineStation/' + id,
    method: 'delete'
  })
}

// 保存站点
export function saveLineStation(data) {
  return request({
    url: '/bus/lineStation/save',
    method: 'post',
    data: data
  })
}

// 修改公交线路
export function changeStatus(data) {
    return request({
        url: '/bus/line/changeStatus',
        method: 'post',
        data: data
    })
}